<?php
	function f251($sql){
		//data handle instance
		//set request
		//define format
		//set format
		//define query string
		//process time
		//process fitler
		$dataHandle = new DataHandle();
		$dataHandle->setRequest("251");

		$action = getValue($_GET['action']);

		if ($action == "getItems"){
			$format = array(
				"modifiedDate" => "datem/d/Y g:i:s A",
				"number" => "numb6",
			);
			$dataHandle->setFormat($format);
			$query = getGetItemsQuery();
			print($dataHandle->printJSON($sql, $query));
		}
		else{
			$temp = array();
			$temp['error'] = "251: Bad request";
			print(json_encode($temp));
		}

		unset($dataHandle);

	}

	function getGetItemsQuery(){

		$ID = getValue($_GET['id']);

		$queryString = "
			select
				product_id as number,
				mixing_cost_included as mixingCostIncluded,
				description,
				line_id as Line,
				unit,
				modified_by as modifiedBy,
				modified_date as modifiedDate,
				notes,
				weight_per_unit as weightPerUnit,
				pouches_per_unit as pouchesPerUnit,
				units_per_hour as unitPerHour,
				speed as speedGroup
			from lin_products
			where active = 1 and product_id = ".$ID;

		return $queryString;
	}
?>